package models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import play.db.jpa.GenericModel;

@Entity
public class SkillSubCategory extends GenericModel {

	@Id
	@Column(name = "SKILL_SUBCATEGORY_ID")
	private int skillCategoryID;

	@Column(name = "subcategory_name")
	private String subcategoryName;

	public SkillSubCategory() {
		this(0, null);
	}

	public SkillSubCategory(int skillCategoryID, String subcategoryName) {
		super();
		this.skillCategoryID = skillCategoryID;
		this.subcategoryName = subcategoryName;
	}

	public int getSkillCategoryID() {
		return skillCategoryID;
	}

	public void setSkillCategoryID(int skillCategoryID) {
		this.skillCategoryID = skillCategoryID;
	}

	public String getSubcategoryName() {
		return subcategoryName;
	}

	public void setSubcategoryName(String subcategoryName) {
		this.subcategoryName = subcategoryName;
	}

	@Override
	public String toString() {
		return "SkillSubCategory [skillCategoryID=" + skillCategoryID
				+ ", subcategoryName=" + subcategoryName + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + skillCategoryID;
		result = prime * result
				+ ((subcategoryName == null) ? 0 : subcategoryName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		SkillSubCategory other = (SkillSubCategory) obj;
		if (skillCategoryID != other.skillCategoryID)
			return false;
		if (subcategoryName == null) {
			if (other.subcategoryName != null)
				return false;
		} else if (!subcategoryName.equals(other.subcategoryName))
			return false;
		return true;
	}
}
